package fr.labri.buganalyzer.extractors;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class BugzillaUtils {
	
	public final static String trackerType = "Bugzilla";
	public final static String eclipseBgzUrl = "https://bugs.eclipse.org/bugs/";
	public final static String apacheBgzUrl = "https://issues.apache.org/bugzilla/";
	
	
	public final static String bgzProductToken = "describecomponents.cgi?product=";
	public final static String bgzBugsLimitToken = "&component="; 
	public final static String bgzBugXmlToken = "show_bug.cgi?ctype=xml";
	public final static String bgzBugListToken =  "buglist.cgi?product=";
	public final static String bgzShowActivityToken = "show_activity.cgi?id=";
	
	public static Timestamp getTimestamp(String date){
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss Z");
		java.util.Date parsedDate = null;
		try {
			parsedDate = dateFormat.parse(date);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		java.sql.Timestamp timestamp = new java.sql.Timestamp(parsedDate.getTime());
		return timestamp;
	}
 
}
